#include <iostream>

using namespace std;

int main()
{
	int cnt = 0;
	for (int a = 1; a < 10; a++){
		for (int b = 1; b < 10; b++){
			if (a != b){
				for (int c = 1; c < 10; c++){
					if (a != c && b != c){
						for (int d = 1; d < 10; d++){
							if (a != d && b != d&&c != d){
								for (int e = 1; e < 10; e++){
									if (a != e&&b != e&&c != e&&d != e){
										//  ab * cde == adb * ce
										if ((a * 10 + b)*(c * 100 + d * 10 + e) == (a * 100 + d * 10 + b)*(c * 10 + e)){
											printf("(%d * 10 + %d)*(%d * 100 + %d * 10 + %d) == (%d * 100 + %d * 10 + %d)*(%d * 10 + %d)\n",\
												a, b, c, d, e, a, d, b, c, e);
											cnt++;
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	cout << cnt << endl;
	return 0;
}